import random
import string

#  生成包含关键词的函数
def generate_random_string_with_substring(min_length=50, max_length=300, substring="发送数据给NCC"):
    total_length = random.randint(min_length, max_length)
    remaining_length = total_length - len(substring)
    random_part = ''.join(random.choices(string.ascii_letters + string.digits, k=remaining_length))
    insert_point = random.randint(0, remaining_length)
    result_string = random_part[:insert_point] + substring + random_part[insert_point:]
    return result_string

# 原始数据删除关键词
def replace_substring(s, old, new):
    return s.replace(old, new)
# 生成随机数据
def generate_random_string(min_length=50, max_length=300):
    total_length = random.randint(min_length, max_length)
    random_string = ''.join(random.choices(string.ascii_letters + string.digits, k=total_length))
    return random_string

# 使用 for 循环调用函数2500次并打印结果
for i in range(2500):
    random_string = generate_random_string_with_substring()
    modified_string = replace_substring(random_string, "发送数据给NCC", "             ")
    rand_string = generate_random_string()
    print(random_string)
    print(modified_string)
    print(rand_string)
